package sk.uniza.fri.cerviix.server.network.messages.server;

import java.io.IOException;

import sk.uniza.fri.cerviix.server.network.MessageType;
import sk.uniza.fri.cerviix.server.network.ServerMessage;

public class PlayerAddMessage extends ServerMessage
{
	private int playerId;
	private String playerName;
	
	public PlayerAddMessage(int playerId, String playerName)
	{
		this.playerId = playerId;
		this.playerName = playerName;
	}
	
	@Override
	public void send() throws IOException
	{
		setHeader(MessageType.PLAYER_ADD);
		
		stream.writeInt(playerId);
		stream.writeUTF(playerName);
	}
}
